<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script>
			function $$(id){
				return document.getElementById(id);
			}
			window.onload = function () {
				var cnv = $$("canvas");
				var cxt = cnv.getContext("2d");
				
				var text = "绿叶学习网";
				cxt.font = "bold 20px 微软雅黑";
				
				cxt.fillStyle = "hotpink";
				cxt.save();
				cxt.fillText(text,50,40);
				
				cxt.fillStyle = "lightblue";
				cxt.fillText(text,50,80);
				
				cxt.restore();
				cxt.fillText(text,50,120);
				
			}
		</script>
	</head>
	<body>
		<canvas id="canvas" width="200" height="180" style="border:1px dashed gray;"></canvas
	</body>
</html>
